package com.liugh.entity.standard;


import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Id;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by Fatao on 2018/9/27
 * 标准条目
 *
 */


@Builder
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName("standard_item")
public class StandardItem extends Model<StandardItem> implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @Id
    private int id;

    /**
     * 编号，用户自己上传的时候定制
     */
    @TableField("category")
    private int category;

    @TableField(exist = false)
    private String categoryName;

    /**
     * 标准编号
     */
    @TableField("stand_no")
    private String standNo;

    /**
     * 标准名称
     */
    @TableField("stand_name")
    private String standName;

    /**
     * 标准状态
     * 0-有效
     * 1-废止
     */
    @TableField("stand_status")
    private int standStatus;

    /**
     * 采标状态
     */
    @TableField("stand_attach")
    private int standAttach;

    /**
     * 文件上传后的URL
     */
    @TableField("upload_dir")
    private String uploadDir;

    /**
     * 上传者的userNo
     */
    @TableField("author")
    private String author;  //上传者

    /**
     *创建时间
     */
    @TableField("create_time")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    private Date updateTime;

    @TableField("lib_type")
    private int libType;  //库的类型

    @TableField("approve_status")
    private int approveStatus = -1; //申请状态，默认是未申请

    @TableField(exist = false)
    private String userName;

    /**
     *  返回前十二张条目图片 .
     */
    @TableField(exist = false)
    private List<StandardPage> standardPages;



    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
